package com.mopon.springbootmvc.aspect;

import java.util.Arrays;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LogAspect {

	@Before("execution(* com.mopon.springbootmvc.dao..*.*(..))")
	public void log() {
		System.out.println("before method log done");
	}
	
	@After("execution(* com.mopon.springbootmvc.dao..*.*(..))")
	public void log2(JoinPoint point) {
		System.out.println("after method log done " + point.getTarget().getClass() + ", " 
				+ Arrays.toString(point.getArgs()) + ", method=" + point.getSignature().getName());
	}
}
